﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ImageCropper.Lib
{
    public enum Direction
    {
        North,
        NorthWest,
        NorthEast,
        West,
        East,
        South,
        SouthWest,
        SouthEast
    }

    public enum Axis
    {
        NorthSouth,
        EastWest,
        NorthEastSoutWest,
        NorthWestSouthEast
    }

    public static class DirectionExtensions
    {
        public static Direction GetOpposite(this Direction dir)
        {
            switch (dir)
            {
                case Direction.South:
                    return Direction.North;

                case Direction.East:
                    return Direction.West;

                case Direction.SouthEast:
                    return Direction.NorthWest;

                case Direction.West:
                    return Direction.East;

                case Direction.SouthWest:
                    return Direction.NorthEast;

                case Direction.NorthWest:
                    return Direction.SouthEast;

                case Direction.North:
                    return Direction.South;

                case Direction.NorthEast:
                    return Direction.SouthWest;

                default:
                    throw new ArgumentException("Unknown Direction");
            }
        }
    }
}
